package com.zzj.hotel.core.utils;

public class PageUtil {
	private int page;
	private int nextPage;
	private int lastPage;
	private int totalPage;
	private int pageSize;
	private int totalCount;
	private int start;
	private int end;
	
	public int getStart() {
		return start;
	}

	public void setStart() {
		this.start = (page-1)*PAFESIZE;
	}

	public int getEnd() {
		return end;
	}

	public void setEnd() {
		this.end = start + PAFESIZE;;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getNextPage() {
		return nextPage;
	}

	public void setLastPage() {
		if(page<2){
			this.lastPage = 1;
		}else{
			this.lastPage = page-1;
		}
	}

	public int getLastPage() {
		return lastPage;
	}

	public void setNextPage() {
		if(totalPage>page){
			this.nextPage = page + 1;
		}else{
			this.nextPage = page;
		}
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage() {
		if(totalCount%PAFESIZE==0){
			this.totalPage = totalCount/PAFESIZE;
		}else{
			this.totalPage = totalCount/PAFESIZE+1;
		}
		if(totalCount == 0){
			this.totalPage = 1;
		}
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize() {
		this.pageSize = PAFESIZE;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public static final int PAFESIZE = 10;
	public static void main(String[] args) {
		System.out.println(9/10);
	}
}
